#define ElemType int

typedef struct ListNode List_Node;

#include "common.h"

int numSubarrayProductLessThanK(int* nums, int numsSize, int k);

int main()
{
	return 0;
}

int numSubarrayProductLessThanK(int* nums, int numsSize, int k)
{
	if (k <= 1) return 0;

	int prod = 1, ans = 0, left = 0;
	for (int right = 0; right < numsSize; right++) {
		prod *= nums[right];
		while (prod >= k) prod /= nums[left++];
		ans += right - left + 1;
	}

	return ans;
}
